<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
	
      <p:dialog widgetVar="pnlDetailOrder" header="Pedido" modal="true" resizable="false" draggable="false" closable="false" width="300">
        <p:outputPanel id="pnlDetailOrder">  
        <p:messages />
        <h:panelGrid columns="3" >

          <h:outputText value="Data pedido:" />
          <p:spacer width="8" />
          <p:inputMask value="#{orderAction.selectedOrder.orderDate}" mask="99/99/9999" disabled="true" >
            <f:convertDateTime pattern="dd/MM/yyyy" />
          </p:inputMask>
          <h:outputText value="Produto:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.product.name}" disabled="true" />
          <h:outputText value="Forncedor:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.seller.name}" disabled="true" />
          <h:outputText value="Situação:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.status.name}" disabled="true" />
          <h:outputText value="Data recebimento:" />
          <p:spacer width="8" />
          <p:inputMask value="#{orderAction.selectedOrder.arriveDate}" mask="99/99/9999" disabled="true" >
            <f:convertDateTime pattern="dd/MM/yyyy" />
          </p:inputMask>
          <h:outputText value="Valor compra:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.buyValue}" disabled="true" >
            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" locale="pt_BR" pattern="#,##0.00" />
          </p:inputText>  
          <h:outputText value="Moeda:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.currencyType.name}" disabled="true" />
          <h:outputText value="Cotação moeda:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.currencyValue}" disabled="true" >
            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" locale="pt_BR" pattern="#,##0.00" />
          </p:inputText>  
          <h:outputText value="Valor compra:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.buyValue}" disabled="true" >
            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" locale="pt_BR" pattern="#,##0.00" />
          </p:inputText>
          <h:outputText value="Valor frete:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.shippingValue}" disabled="true" >
            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" locale="pt_BR" pattern="#,##0.00" />
          </p:inputText>
          <h:outputText value="Valor taxas:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.taxValue}" disabled="true" >
            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" locale="pt_BR" pattern="#,##0.00" />
          </p:inputText>
          <h:outputText value="Valor total U$:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.totalDollarBuyValue}" disabled="true" >
            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" locale="pt_BR" pattern="#,##0.00" />
          </p:inputText>
          <h:outputText value="Valor total R$:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.totalBuyValue}" disabled="true" >
            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" locale="pt_BR" pattern="#,##0.00" />
          </p:inputText>
          <h:outputText value="Data venda:" />
          <p:spacer width="8" />
          <p:inputMask value="#{orderAction.selectedOrder.sellDate}" mask="99/99/9999" disabled="true" >
            <f:convertDateTime pattern="dd/MM/yyyy" />
          </p:inputMask>
          <h:outputText value="Valor venda:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.sellValue}" disabled="true" >
            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" locale="pt_BR" pattern="#,##0.00" />
          </p:inputText>
          <h:outputText value="Lucro:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.totalGainValue}" disabled="true" >
            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" locale="pt_BR" pattern="#,##0.00" />
          </p:inputText>
          <h:outputText value="Situação venda:" />
          <p:spacer width="8" />
          <p:inputText value="#{orderAction.selectedOrder.sellStatus.id ne 0 ? orderAction.selectedOrder.sellStatus.name : ''}" disabled="true" />
          <h:outputText value="Data pagamento:" />
          <p:spacer width="8" />
          <p:inputMask value="#{orderAction.selectedOrder.paymentDate}" mask="99/99/9999" disabled="true" rendered="#{orderAction.selectedOrder.paymentDate ne null}" >
            <f:convertDateTime pattern="dd/MM/yyyy" />
          </p:inputMask>
          <p:inputText value="#{orderAction.selectedOrder.paymentStatus.name}" disabled="true" rendered="#{orderAction.selectedOrder.paymentDate eq null}" />
        </h:panelGrid>
        <p:spacer height="10" />
        <h:panelGrid columns="1" >
          <h:panelGroup >
            <p:commandButton oncomplete="pnlDetailOrder.hide();" value="fechar" immediate="true" />
          </h:panelGroup>
        </h:panelGrid>
        </p:outputPanel>
      </p:dialog>    

</ui:composition>

